﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using WanPiJie.Utilities;

namespace WanPiJie.WebSite.Management
{
	public partial class Default : PageBase
	{
		/// <summary>
		/// 商品分类列表
		/// </summary>
		protected IList<ProductCatalog> CatalogList
		{
			get;
			private set;
		}


		protected override void HttpGetProcess()
		{
			this.Initialize();
		}

		protected override void HttpPostProcess()
		{
			String catalogName = PV("catalogName");
			if (String.IsNullOrEmpty(catalogName))
				ShowMessage("请输入商品分类名称");
			else
				ProductService.Instance.AddCatalog(catalogName);
			this.Initialize();
		}

		private void Initialize()
		{
			this.CatalogList = ProductService.Instance.GetCatalog();
		}
	}
}